{% extends "base.html" %}
{% block content %}
<h1>About ObViews</h1> 
<p>
  Wraps <a class="ext-link" href="http://www.djangoproject.com/"
  target="_blank"><span class="icon">Django</span></a> views into callable
  objects.
</p>
<h2>What this website is about</h2>
<p>
  This website is a <b>demo</b>. Its purpose is to illustrate the
  piece of code provided in <a class="ext-link"
  href="http://code.google.com/p/django-generate-views/"
  target="_blank"><span class="icon">django-generate-views</span></a>
  module, <strong>wich provides the base classes to write views with
  <code>objects</code> in place of
  <code>functions</code></strong>. Obviews.com does not mean to
  explain object views from the beggining, neither all their
  philosophy: you will find <a class="ext-link"
  href="http://djangoandme.blogspot.com/" target="_blank"><span
  class="icon">my blog</span></a> for that. You might also want to
  check <a class="ext-link"
  href="http://groups.google.com/group/django-generate-views?hl=fr"
  target="_blank"><span class="icon">the discussions</span></a> about
  this, even if, at this opening hour, there is not many people to
  discuss... feel free top change this.
</p>
<h2>What this page is about</h2>
<p>
  This page is a simple example - the first -. Each pages will illustrate
  a functionnality of obviews, all listed on the righ
  sidebar/navigation. So... let's begin...
</p>
<p>
  This view illustrates the alternative to
  <code>direct_to_template</code>. It is a static view which simply
  displays the given template. Class is defined with only one
  attribute: <code>template_name</code>
</p>
<div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">obviews.views</span> <span class="kn">import</span> <span class="n">View</span><span class="p">,</span> <span class="n">FormView</span><span class="p">,</span> <span class="n">CutResponse</span>

<span class="c"># Equivalent to direct_to_template</span>
<span class="k">class</span> <span class="nc">DirectView</span><span class="p">(</span><span class="n">View</span><span class="p">):</span>
    <span class="n">template_name</span> <span class="o">=</span> <span class="s">&quot;about.html&quot;</span>

<span class="n">urlpatterns</span> <span class="o">=</span> <span class="n">patterns</span><span class="p">(</span><span class="s">&#39;&#39;</span><span class="p">,</span>
    <span class="p">(</span><span class="s">&#39;^$&#39;</span><span class="p">,</span> <span class="n">DirectView</span><span class="p">()),</span>
<span class="p">)</span>

</pre></div>
<p>
  As you can see in this example, an instance of the view is associate
  with the appropriate URL. We will see in <strong>next example</strong> how this allow
  to <a href="/welcome/">pass static variables</a> into the context of
  the view.
</p>
{% endblock %}
